select	a12.L1_Code  L1_Code,
	max(a12.L1)  UserDefinedCodesValues,
	a12.L2_surrogatekey  L2_Code,
	max(a12.L2)  UserDefinedCodesValues0,
	a14.ShiptoNumber  ShiptoNumber,
	max(a14.ShiptoName)  ShiptoName,
	a12.ItemNumber02  ItemNumber02,
	max(a12.Description01)  Description011,
	a15.FiscalMonth  FiscalMonth,
	sum(a11.ExtendedPrice)  WJXBFS1,
	sum(a11.ExtendedCost)  WJXBFS2,
	sum((a11.LB * a11.QuantityShipped))  WJXBFS3
from	Sales_Star_Facts	a11
	join	Common_Star_Item	a12
	  on 	(a11.ItemNumberID = a12.ItemNumberID)
	join	Sales_Star_FactsExt	a13
	  on 	(a11.FactsExtID = a13.FactsExtID)
	join	Sales_Star_Customer	a14
	  on 	(a11.CustomerNumberID = a14.CustomerNumberID)
	join	Common_Star_Dates	a15
	  on 	(a11.GLDateID = a15.CompanyDateID)
where	(a13.TransactionType in (2)
 and a14.ShiptoSearchTypeCode in ('CC ', 'CCS', 'CCX', 'CE ', 'CF ', 'CFD', 'CFP', 'CFS', 'CFX')
 and a13.OrderTypeCode in ('CO', 'SD', 'SO', 'SU')
 and a11.ShiptoNumber <> 6569584
 and a12.L1_Code in ('COF')
 and a12.L2_surrogatekey in ('COFRAG')
 and a15.Dates between '2012-04-01' and '2012-04-15')
group by	a12.L1_Code,
	a12.L2_surrogatekey,
	a14.ShiptoNumber,
	a12.ItemNumber02,
	a15.FiscalMonth
